<?php
/**
 * Created by PhpStorm.
 * User: qingyun
 * Date: 17/2/18
 * Time: 下午2:43
 */
namespace Common\Controller;

/**
 * Admin后台基础类
 * Class AdminBaseController
 * @package Common\Controller
 */
class AdminBaseController extends BaseController
{
    /**
     * 后台初始化
     */
    public function _initialize(){
        parent::_initialize();
//        $auth = new \Think\Auth();
//        $rule_name = MODULE_NAME . '-' . CONTROLLER_NAME . '-' . ACTION_NAME;
//        $result = $auth->check($rule_name,1);
//        if(!$result){
//            $this->error('您没有权限访问！');
//        }
    }

    public function __construct()
    {
        parent::__construct();
        //检验是否登录
      if(empty(session(C('ADMIN_SESSION')))){
            $this->redirect('Login/index');
      }
    }
}